package com.punai.prodatalibrary.domain;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.punai.common.annotation.Excel;
import com.punai.common.core.domain.BaseEntity;
import com.punai.common.utils.SubBigDecimalTypeHandler;
import com.punai.prodatalibrary.domain.bo.GlobalProInfoBo;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 项目基本信息对象 tab_lib_project_info
 *
 * @author tj
 * @date 2023-03-31
 */
@TableName("tab_lib_project_info")
public class LibProjectInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 序号 */
    private String id;

    /** 项目主编码 */
    @Excel(name = "项目编码")
    private String projectCode;

    /** 项目名称 */
    @Excel(name = "项目名称")
    private String projectName;

    /** 单位名称 */
//    @Excel(name = "单位名称")
    private String unit;

    /** 建设单位 */
    @Excel(name = "建设单位")
    private String constructionUnit;

    /** 项目负责人 */
    @Excel(name = "项目负责人")
    private String projectLeader;

    /** 项目金额 */
    @Excel(name = "项目金额")
    @TableField(typeHandler = SubBigDecimalTypeHandler.class)
    private BigDecimal projectAmount;

    /** 项目地址 */
    @Excel(name = "项目地址")
    private String projectAddress;

    /** 项目开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "项目开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date projectStartDate;

    /** 项目结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "项目结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date projectEndDate;

    /** 项目状态 */
    @Excel(name = "项目状态")
    private String projectState;

    /** 项目所属部门 */
    @Excel(name = "项目所属部门")
    private String projectDept;

    /** 施工单位 */
    @Excel(name = "施工单位")
    private String sgUnit;

    /** 建筑面积 */
    @Excel(name = "建筑面积")
    private String floorArea;

    /** 总工期 */
    @Excel(name = "总工期")
    private String timeLimit;

    /** 国家 */
//    @Excel(name = "国家")
    private String country;

    /** 省份 */
//    @Excel(name = "省份")
    private String province;

    /** 城市 */
//    @Excel(name = "城市")
    private String city;

    /** 地域 */
//    @Excel(name = "地域")
    private String region;

    /** $column.columnComment */
//    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String proId;

    /** 公司id */
//    @Excel(name = "公司id")
    private Long companyId;

    @TableField(exist = false)
    private LibProject libProject;

    public static  LibProjectInfo convet(GlobalProInfoBo bo){
        LibProjectInfo info = null;
        if (bo!=null){
            info = new LibProjectInfo();
            BeanUtil.copyProperties(bo,info);
        }
        return info;
    }

    public LibProject getLibProject() {
        return libProject;
    }

    public void setLibProject(LibProject libProject) {
        this.libProject = libProject;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public String getId()
    {
        return id;
    }
    public void setProjectCode(String projectCode)
    {
        this.projectCode = projectCode;
    }

    public String getProjectCode()
    {
        return projectCode;
    }
    public void setProjectName(String projectName)
    {
        this.projectName = projectName;
    }

    public String getProjectName()
    {
        return projectName;
    }
    public void setUnit(String unit)
    {
        this.unit = unit;
    }

    public String getUnit()
    {
        return unit;
    }
    public void setConstructionUnit(String constructionUnit)
    {
        this.constructionUnit = constructionUnit;
    }

    public String getConstructionUnit()
    {
        return constructionUnit;
    }
    public void setProjectLeader(String projectLeader)
    {
        this.projectLeader = projectLeader;
    }

    public String getProjectLeader()
    {
        return projectLeader;
    }
    public void setProjectAmount(BigDecimal projectAmount)
    {
        this.projectAmount = projectAmount;
    }

    public BigDecimal getProjectAmount()
    {
        return projectAmount;
    }
    public void setProjectAddress(String projectAddress)
    {
        this.projectAddress = projectAddress;
    }

    public String getProjectAddress()
    {
        return projectAddress;
    }
    public void setProjectStartDate(Date projectStartDate)
    {
        this.projectStartDate = projectStartDate;
    }

    public Date getProjectStartDate()
    {
        return projectStartDate;
    }
    public void setProjectEndDate(Date projectEndDate)
    {
        this.projectEndDate = projectEndDate;
    }

    public Date getProjectEndDate()
    {
        return projectEndDate;
    }
    public void setProjectState(String projectState)
    {
        this.projectState = projectState;
    }

    public String getProjectState()
    {
        return projectState;
    }
    public void setProjectDept(String projectDept)
    {
        this.projectDept = projectDept;
    }

    public String getProjectDept()
    {
        return projectDept;
    }
    public void setSgUnit(String sgUnit)
    {
        this.sgUnit = sgUnit;
    }

    public String getSgUnit()
    {
        return sgUnit;
    }
    public void setFloorArea(String floorArea)
    {
        this.floorArea = floorArea;
    }

    public String getFloorArea()
    {
        return floorArea;
    }
    public void setTimeLimit(String timeLimit)
    {
        this.timeLimit = timeLimit;
    }

    public String getTimeLimit()
    {
        return timeLimit;
    }
    public void setCountry(String country)
    {
        this.country = country;
    }

    public String getCountry()
    {
        return country;
    }
    public void setProvince(String province)
    {
        this.province = province;
    }

    public String getProvince()
    {
        return province;
    }
    public void setCity(String city)
    {
        this.city = city;
    }

    public String getCity()
    {
        return city;
    }
    public void setRegion(String region)
    {
        this.region = region;
    }

    public String getRegion()
    {
        return region;
    }
    public void setProId(String proId)
    {
        this.proId = proId;
    }

    public String getProId()
    {
        return proId;
    }
    public void setCompanyId(Long companyId)
    {
        this.companyId = companyId;
    }

    public Long getCompanyId()
    {
        return companyId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("projectCode", getProjectCode())
                .append("projectName", getProjectName())
                .append("unit", getUnit())
                .append("constructionUnit", getConstructionUnit())
                .append("projectLeader", getProjectLeader())
                .append("projectAmount", getProjectAmount())
                .append("projectAddress", getProjectAddress())
                .append("projectStartDate", getProjectStartDate())
                .append("projectEndDate", getProjectEndDate())
                .append("projectState", getProjectState())
                .append("projectDept", getProjectDept())
                .append("sgUnit", getSgUnit())
                .append("floorArea", getFloorArea())
                .append("timeLimit", getTimeLimit())
                .append("country", getCountry())
                .append("province", getProvince())
                .append("city", getCity())
                .append("region", getRegion())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .append("proId", getProId())
                .append("companyId", getCompanyId())
                .toString();
    }
}
